How do I resolve the 'utf

您所在的位置:网站首页 pandas timegrouper How do I resolve the 'utf

How do I resolve the 'utf

#How do I resolve the 'utf| 来源: 网络整理| 查看: 265

You've not really provided enough information to know exactly, but it is likely that the GFile thingy is opening the file specified by path. If that is correct, then the error is likely along the following lines:

GFile is probably opening the file in "text mode". The definition of "text" is that the bytes in the file have to be converted into "text" using some rules. You have not specified what those rules are, so GFile is applying a default, which appears to be "utf-8". For reference, the Python docs talk about what the standard library does. However, the content of the file is not "utf-8" compatible.

Since the file at least contains the byte 0xbb, that does not look like vanilla text. Are you sure the file contains text? At any rate, it is hard to speculate on a fix without you providing more details on the exact form of the content of the file, and the arguments available on GFile.

BTW, I notice that 0xbb is part of a BOM, though not the first character. Some applications on Windows do use BOMs at the start of text files. So if you think it is text, perhaps it is text preceded by a BOM? There are other answers on SO that might help in such cases.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3